<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Repositories\File\FileRepository;

class FileController extends Controller
{
    private $repository;

    public function __construct(FileRepository $repository)
    {
        $this->repository = $repository;
    }
    /**
     * Index interface.
     *
     * @return Content
     */
    public function upload(Request $request)
    {
        $file = $request->file('file');
        $fileType = $request->file('fileType', "default");

        $url = $this->repository->upload($file, $fileType);

        return $this->formatOutput(array("url"=>$url));
    }

}
